home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Meeting Pearls 2
/
Meeting Pearls Vol. II (1995)(GTI - Schatztruhe)[!].iso
/
Pearls
/
text
/
FDB-Data
/
FDB.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-12-20
|
3KB
|
103 lines
/* ARexx-Script für Meeting_Pearls_II
$VER: 0.1 FDB.rexx (17-Dez-94) ©1994 ninji ;-)
Aufruf: rx fdb (if calling from REXX:)
rx FDB.rexx (other)
*/
temp = 'T:fdb-files'
options results
parse arg source dest guide
call addlib( 'rexxsupport.library', 0, -30, 0)
call addlib( 'rexxreqtools.library', 0, -30, 0)
address command 'assign >' || temp 'FindDB: exists'
if (rc ~= 0) then do
rtezrequest( 'Schade ...' || '0a'x ||,
'Sie haben kein Verzeichnis FindDB:' || '0a0a'x ||,
'So sorry ...' || '0a'x ||,
'Missing assign to FindDB:')
exit
end
str = ''
list = ''
if open( tempfile, temp, 'R') then do
do while (~eof( tempfile))
lion = readln( tempfile)
if (lion ~= '') then do
str = substr( lion,wordindex( lion,2))
list = list || showdir( str,'FILE') || ' '
end
end
close( tempfile)
end
else exit
/* selecting .codes */
list2 = ''
do i = 1 for words( list)
str = word( list, i)
if (pos( '.codes', str) ~= 0) then do
str = substr( str, 1, pos( '.codes',str)-1)
if (find( str, liste2) == 0) then
list2 = list2 str
end
end
/* sorting */
list = word( list2, 1)
do i = 2 to words( list2)
str = word( list2, i)
do k = 1 for words( list)
if upper( str) < upper( word( list, k)) then break
end
select
when (k > words( list)) then list = list str
/* when (k == 1) then list = str list */
otherwise list = insert( str '', list, wordindex( list, k) - 1)
end
end
list = list ''
/* getting database */
db = ''
okay = 1
i = 1
do while (okay ~= 0 & db == '')
dblist = ''
if (i > words( list)) then i = 1
do i = i for 10 to words( list)
dblist = dblist ' ' word( list, i) || '0a'x
end
drop okay
db = rtgetstring( ,'Gefundene Datenbasen:' || '0a'x ||,
'found databases' || '0a'x ||,
dblist || 'Gewünschte Datenbasis:' || '0a'x ||,
'your selection',
,,'Okay|»|Esc',,okay)
end
if (okay == 0) then exit
drop okay
find = rtgetstring( ,'Pattern für Suchbegriff:' || '0a'x ||,
'(Search pattern)',
,,,,okay)
if (~okay) then exit
options failat 60
address command 'FDB >' || temp 'db=' || db find
if (rc ~= 0) then do
rtezrequest( 'Entschuldigung ... Sie haben' || '0a'x ||,
'- FDB nicht installiert ?' || '0a'x ||,
'- zu wenig Speicher um Datenbank zu laden ?' || '0a0a'x ||,
'Sorry ... you' || '0a'x ||,
'- forgot to install FDB ?' || '0a'x ||,
'- own to small memory to load database ?')
exit
end
address command ':c/METATOOL' temp 'TEXT'
address command 'delete' temp